The Monitors control panel is the user interface for changing the pixel depth, color capabilities, and positions of video devices. Because the user can control the capabilities of the video devices, your application should be flexible. For instance, although your application may have a preferred pixel depth, it should do its best to accommodate less than ideal conditions.
Your application can use Display Manager functions to change the display mode and display configuration of the user's video devices, but your application should do so only with the consent of the user.
If your application must have a specific pixel depth, for example, it can display a dialog box that offers the user a choice between changing to that depth or canceling display of the image. This dialog box saves the user the trouble of going to the control panel before returning to your application. If it is absolutely necessary for your application to draw on a video device of a specific pixel depth, your application can then use either the
SetDepth
function or the
DMSetDisplayMode
function.
With the possible exception of the
DMSetDisplayMode
function and the
DMMirrorDevices
and
DMUnmirrorDevice
functions, applications should not need to use any of the Display Manager functions that change the user's display configuration. However, they are described for completeness, in case you find a compelling need for your application to change the user's display configuration. If your application must use multiple Display Manager calls that configure the user's displays, your application should first use the
DMBeginConfigureDisplays
function to postpone Display Manager configuration checking, the rebuilding of desktop regions, and Apple event notification of Display Manager changes. When finished configuring the user's displays, use the
DMEndConfigureDisplays
function. Using
DMBeginConfigureDisplays
and
DMEndConfigureDisplays
allows your application to wait until it has made all display changes before managing its windows in response to a single Display Notice event. It is important to pass the
displayState
variable obtained in
DMBeginConfigureDisplays
to the
DMEndConfigureDisplays
function.